/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package domen;

import model.Storage;

/**
 *
 * @author student1
 */
public class Korisnik extends Entitet {

    private String ime;
    private String prezime;
    private String email;
    private String korisickoIme;
    private String korisnickaSifra;

    /**
     * @return the ime
     */
    public String getIme() {
        return ime;
    }

    /**
     * @param ime the ime to set
     */
    public void setIme(String ime) {
        this.ime = ime;
    }

    /**
     * @return the prezime
     */
    public String getPrezime() {
        return prezime;
    }

    /**
     * @param prezime the prezime to set
     */
    public void setPrezime(String prezime) {
        this.prezime = prezime;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the korisickoIme
     */
    public String getKorisickoIme() {
        return korisickoIme;
    }

    /**
     * @param korisickoIme the korisickoIme to set
     */
    public void setKorisickoIme(String korisickoIme) {
        this.korisickoIme = korisickoIme;
    }

    /**
     * @return the korisnickaSifra
     */
    public String getKorisnickaSifra() {
        return korisnickaSifra;
    }

    /**
     * @param korisnickaSifra the korisnickaSifra to set
     */
    public void setKorisnickaSifra(String korisnickaSifra) {
        this.korisnickaSifra = korisnickaSifra;
    }

//@Override
//    public String toString(){
//        return "Korisnik:\n" +
//               "Ime: " + getIme() + "\n" +
//               "Prezime: " + getPrezime() + "\n" +
//               "Email: " + getEmail() + "\n" +
//               "Korisnicko ime: " + getKorisickoIme()+ "\n" +
//               "Korisnicka sifra: " + getKorisnickaSifra()+ "\n";
//        
//    }
    @Override
    public String toString() {
        return getIme() + " " + getPrezime();
    }

//    @Override
//    void ubaciEntitet(Object o) {
//        Korisnik k = (Korisnik) o;
//        String key = k.getKorisickoIme();
//        Storage.getInstance().getMapaPodataka().put(key, k);
//    }
    @Override
    public void ubaciEntitet() {
        String key = this.getKorisickoIme();
        Storage.getInstance().getMapaPodataka().put(key, this);
       
    }

    @Override
    boolean uporedi(Entitet e) {
        if (e instanceof Korisnik ) {
            return true;
        }
        return false;
    }
}
